import Vue from 'vue'
import Router from 'vue-router'

const home = () => import('../views/home')
const airInfo = () => import('../views/airInfo')
const  temperature= () => import('../views/temperature')
const humidity=()=>import('../views/humidity')
const  carbonDioxide= () => import('../views/carbonDioxide')
const formaldehyde=()=>import('../views/formaldehyde')
const PM=()=>import('../views/PM2.5')
Vue.use(Router)
const router = new Router({
    routes:[
        {
            path: '/',
            redirect: '/home'
        },
        {
            path:'/home',
            name:'home',
            component:home
        },
        {
            path:'/airInfo',
            name:'airInfo',
            component:airInfo,
        },
        {
            path:'/temperature',
            name:'temperature',
            component:temperature,
            meta: {
                title: '温度详情'
              }
        },
        {
            path:'/humidity',
            name:'humidity',
            component:humidity,
            meta: {
                title: '湿度详情'
              }
        },
        {
            path:'/carbonDioxide',
            name:'carbonDioxide',
            component:carbonDioxide,
            meta: {
                title: '二氧化碳浓度详情'
              }
        },
        {
            path:'/formaldehyde',
            name:'formaldehyde',
            component:formaldehyde,
            meta: {
                title: '甲醛浓度详情'
              }
        },
        {
            path:'/PM',
            name:'PM',
            component:PM,
            meta: {
                title: 'PM2.5浓度详情'
              }
        },

    ]
})
export default router
